<template>
  <div style="overflow-y: scroll; flex-grow: 1; position: fixed; left: 0; bottom: 0; height: calc(100% - 120px)">
    <el-row>
      <el-col v-for="(item, index) in list" :key="index" :span="6">
        <div style="width: 100%">
          <a :href="item.url" target="_blank">
            <news-card :index="index" :form-data="item"/>
          </a>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>

import hotApi from '../../api/hotApi'
// import NewsCardView from './NewsCardView'
import NewsCard from './NewsCard'

export default {
  name: 'Baidu',
  components: {
    // NewsCardView,
    NewsCard
  },
  data() {
    return {
      list: [],
      total: 0
    }
  },
  created() {
    this.init()
  },
  methods: {
    init() {
      hotApi.getHotList('baidu').then(res => {
        this.list = res.data.list
        this.total = res.data.total
        console.log(this.list)
      }).catch(res => {
      })
    }
  }
}
</script>

<style scoped>

span {
  margin: 10px 10px;
  overflow:hidden;
  text-overflow:ellipsis;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  font-size: 13px;
  color: #999;
}

.time {
  font-size: 13px;
  color: #999;
}

.bottom {
  margin-top: 13px;
  line-height: 12px;
}

.button {
  padding: 0;
  float: right;
}

.image {
  width: 100%;
  display: block;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}

.clearfix:after {
  clear: both
}

.image-wrapper{
  width: 100%;
}
.image-wrapper img{
  width: 100%;
}

</style>
